import {
	RANDOMWALLPAPER,
	TYPEWALLPAPER,
} from './mutations-type.js'
import state from './state.js';
export default {
	// 随机壁纸(轮播图)
	[RANDOMWALLPAPER](state, value) {
		value.vertical.forEach(item => {
			item.title = item.tag.toString();
		})
		state.isRandomWallpaper = value.vertical;
	},
	// ScrollList 横向滚动壁纸分类
	[TYPEWALLPAPER](state, value) {
		state.isTypeWallpaperList = value.category;
	},
	// 设备数据
	initTequipmentInfo(state, value) {
		let {
			model,
			appId,
			windowWidth,
			windowHeight
		} = value;
		state.isAbouTequipment.name = model;
		state.isAbouTequipment.id = appId;
		state.isAbouTequipment.tequipmentWidth = windowWidth;
		state.isAbouTequipment.tequipmenHeight = windowHeight;
	},
	// 加载更多组件
	activeStatus(state, value = null) {
		state.isLoadmore.status = value.isStatus;
		state.isLoadmore.activeShow = value.isShow;
	},
	// 首页初始化壁纸图片
	typeWallpaper_list(state, value) {
		value.forEach(item => {
			item.title = item.tag.toString();
		})
		state.isHomeRandomWallpaperList = value;
	},
	// 分类壁纸详细
	currentTypeWallpaper(state, value) {
		state.isCurrentTypeWallpaper = value;
	},
	// 获取当前壁纸，类型为对象
	currentWallpaperObj(state, value) {
		state.isCurrentWallpaperObj = value;
	},
	// 获取当前分类壁纸，类型为数组
	currentWallpaperArr(state, value) {
		value.forEach(item => {
			item.title = item.tag.toString();
		})
		state.isCurrentWallpaperArr = value;
	},
	// 获取当前分类壁纸索引
	currentWallpaperIndex(state, value) {
		state.isCurrentWallpaperIndex = value;
	},
	// 判断当前是否单个的壁纸还是分类的全部壁纸
	activeWallpaperType(state, value) {
		state.isWallpaperType = value;
	},
	// 当前单个壁纸详细情况
	currentWallpaperObjInfo(state, value) {
		state.isCurrentWallpaperObjInfo = value;
		// console.log(state.isCurrentWallpaperObjInfo);
	},
	// 获取当前手机型号
	currentPM(state, value) {
		state.currentPhoneModel = value;
	},
	// 获取当前状态栏高度
	currentStateTop(state, value) {
		state.currentStateBarTop = value;
	},
}
